package com.oocl.zero.datahandle.util;

import java.util.Set;

import com.oocl.zero.datahandle.entity.Customer;

public class CustomerPrinter {

	public static StringBuilder getXmlStyle(Customer c) {
		StringBuilder buf=new StringBuilder();
		
			
			int id = c.getId();
			String name = c.getName();
			String email = c.getEmail();
			boolean gender = c.isGender();
			String birthday = c.getBirthdayView();
			buf.append("<Customer id='"+id+"'>");
			buf.append(" ");
			
			buf.append(" <name>" + name + "</name>");
			buf.append(" ");
		
			buf.append(" <email>" + email + "</email>");
			buf.append(" ");
			
			buf.append(" <gender>" + gender + "</gender>");
			buf.append(" ");
			
			buf.append(" <birthday>" + birthday + "</birthday>");
			buf.append(" ");
				
			buf.append("</Customer>");
			
		return buf;
	}

	public static StringBuilder getLineStyle(Set<Customer> set) {
		StringBuilder buf=new StringBuilder();
		for (Customer c : set) {
			buf.append(c.toString());
			//buf.append("\n");
		}
		return buf;
	}

}
